import Vue from "vue"; // 引入 Vue 框架
import Vuex from "vuex"; // 引入 Vuex 状态管理库
import permissions from "./modules/permissions"; // 引入权限模块

Vue.use(Vuex); // 注册 Vuex 插件

export default new Vuex.Store({
  state: {
    receivedName: '',
  },
  mutations: {
    setReceivedName(state, name) {
      state.receivedName = name;
    },
    clearReceivedName(state) {
      state.receivedName = '';
    },
  },
  getters: {
    receivedName: (state) => state.receivedName,
  },
  modules: {
    permissions, // 注册权限模块
  },
});
